package com.ufox.configure;

import java.io.FileWriter;
import java.io.IOException;
/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */


public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121601601";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDau+7XrjuHhBt/L4CtcnS9EW6y3r+ttPm9Y5v3PaR30AG6SiGaxHCspqjhuiA8NOwQVHLAj7K2q5KfwfRJVcWaiZDQoFOpFeLcYXNmCpsm1OrG5w4PHp5NDEPtmYLtAvrB2Erqg7quYvevJiWCt1mUd1EJeFH0MZSXfkYzNIJPR02FHPGUcA8RA1ZaAcveolUlhGlrztohjdPeDsn22qpMkixyDEiGtFVrfjShHr+bQqLOre4+Ku6cw8zLWrw4mf4d6i03XS3xp4kijij5WLBZoyijopq4ShVlkNasE5WH9lgu1OHLy6BXNk8rinyJ6eRLem4Eh5w3g41uTFtIID/VAgMBAAECggEBALyc0Zep5is0/4DstUjbKU7feVVEPoTLSY7GFfdccDXgZ5z7z35lZcN68qWymZlRCT4Lk+f4AWMDD6wy0zNpgrt/ZCCCH6Ht/XGLlram7qLNdqWNF9Jx1I8bxHddqEg4CYKdv/v5G0DElk+x1Saic9xSBs7jscef+UGo4V/GJ5ezjEphui9BHaHqmDTfYfdJP9E0xBmEQWoBiv1CEzRqcW+HUm9pW+HaqXycZB7vEL5j/vbLSg9a47j9CxfuMy/iU95LNjhHtCfy5jnS94VZYvp0ZkiStWHNWz3uVYq6zoBfcAGqO3D8L/SynnOEP2DmzPHzx4yQGqyIJiwmBnNfQAECgYEA7VBbVhe9DZEphvmnLzl3g9FNIt4MO9JdvqGSHP2EsMrYpV4PZtWTGAHjpC5ljJukkSok2JFSQKenlhhXB1g98OsqRLSnJAZE3HE4u8TYMCbAIhOjYWUwmC8jj8GJohrQFfjzrX546Ed+/sORRrImdtZyfLzS1g2KiP2FyjqGX8ECgYEA6/UOIDGhjV9XqYtM4dVjZH0lfnGZnhmKAhtgepIifLkh4+UKKrN99pEBoLRy0on17UgBG6SPrZPWnTx3n92nH8AXFNpGzD2Lx3PmvkXSE2N800KesIi49XqDzXiGpb/b0dx3Gz7dcRlqsDJ4i323Cw/YbMjnVRwwTraXXsgjpRUCgYEA10l08q9qZKpyH+7QCnl5wO3Zqm4CbyqyvMPax8392FzNGYgxNLtATCE6oLEuktaH/uFat9Vt5xWxZOsD2LfmyW6t09KHZpkBU3KrYzx6W4Rr/P4P08V2xjjNbBbJg3QLnkNQ3O3FRgPGY9yLKLVpS5nUFvE9285BBXHpM8LQMIECgYAMme3DMmNaVXktCM92UBsaxsQ12INHuj1wl12zrhJBbvGsZhMA7M0RWfUoS/rF27BSl8HXZBZ4Qqj3hL8uvnuqamvRJUcaqT7JzBrKlpf9iRalga1P6D1Yfs6DLqiiOXjX4FpMDjNtUtorxsZBTNl1scbxKFmSZgr+aSn0WePtcQKBgGih8ADErhK/FsLUhll0fdXAm3QE2jrWNtV6/V/aFa6TKmpcrHiwF0o7/Np2x/EF4UPO4+LH9pDJH50bk1dG/eAhbiu2ciSIbT9rG9sfKRM9vmZxPicu9FmWxCeJVo6oRyflCgQKq8049kPlC5cFxflQYcibtr0fbqY1LwQ5hRDv";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiNql8XVfh5s5UxBwg3tJZnLk824X8+Gj5VkYzTfU+LLIURTMM1vOIBatJMVJXCO+kC8AX1bT+dihI6CXEmfgSJ+eCNDWktGnqWBm6T1VqS23Ipw37Zny10YFpcPidU0nkc+gbQEQbfYR4BzSAs48EBsubhfJeVw1R8c6ZkkzyY8ymQqN4zuYf3ogmfPt5Z7hquiueneHl2eBljVs3ecM6F1fa0VJ9/FF3c7+C5HvO0+0Ja+e3oAMLR8gTbpvQ3qxIPCN9lmTJ8o8uscI+u3lpZHdg8xdJDd7wc6IBjXFqgvJF9tEdOc5KSX2fWeSioxXv68oIW5L3JnIFXD+HJVHSQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //public static String notify_url = "http://192.168.4.79/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //public static String return_url = "http://192.168.4.79/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    //public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

